import { ADName } from "../SDKDefine";
import SDKAd from "./SDKAd";
import SDKAppBoxAd from "./SDKAppBoxAd";
import SDKBannerAd from "./SDKBannerAd";
import SDKBlockAd from "./SDKBlockAd";
import SDKGamePortalAd from "./SDKGamePortalAd";
import SDKInterstitialAd from "./SDKInterstitialAd";
import SDKNativeAd from "./SDKNativeAd";
import SDKRewardedAd from "./SDKRewardedAd";

export class SDKAdFactory {

    static build(name: string): SDKAd {
        let ins = null;
        switch (name) {
            case ADName.banner:
                ins = new SDKBannerAd()
                break;
            case ADName.reward:
                ins = new SDKRewardedAd()
                break;
            case ADName.insert:
                ins = new SDKInterstitialAd()
                break;
            case ADName.block:
                ins = new SDKBlockAd()
                break;
            case ADName.native:
                ins = new SDKNativeAd();
                break;
            case ADName.portal:
                ins = new SDKGamePortalAd();
                break;
            case ADName.appbox:
                ins = new SDKAppBoxAd();
                break;

        }
        return ins;
    }
}